import request from '@/utils/request'

// 生成报告
export function generateReportRequest(data) {
  return request({
    url: '/gene-face/gene-report/generate', method: 'post', data: data, timeout: 1000 * 60 * 60
  })
}

/**
 * 查询药物风险列表
 * @param params
 * @returns {AxiosPromise}
 */
export function getUserRiskDrugList(params) {
  return request({
    url: '/gene-face/gene-report/getUserRiskDrugList', params: params, method: 'get'
  })
}

// 查询基因报告列表
export function listGeneReport(query) {
  return request({
    url: '/gene-face/gene-report/list', method: 'get', params: query
  })
}

// 查询基因结果详细列表
export function detailGeneResult(query) {
  return request({
    url: '/gene-face/gene-report/detail', method: 'get', params: query
  })
}

// 查询基因结果详细
export function getTbGeneReportDetail(query) {
  return request({
    url: '/gene-face/gene-report/getTbGeneReportDetail', method: 'get', params: query
  })
}

// 查询基因原始报告详细
export function getTbGeneReportXls(query) {
  return request({
    url: '/gene-face/gene-report/getTbGeneReportXls', method: 'get', params: query
  })
}

// 查询基因原始报告详细
export function reportList(query) {
  return request({
    url: '/gene-face/drugGeneRs/reportList', method: 'get', params: query
  })
}

// 删除基因报告
export function delGeneReport(id) {
  return request({
    url: '/gene-face/gene-report/' + id, method: 'delete'
  })
}
// 审核基因报告
export function auditGeneReport(id) {
  return request({
    url: '/gene-face/gene-report/audit/' + id, method: 'get'
  })
}
//
export function getDrugReport(query) {
  return request({
    url: '/geneface/pdf', method: 'get', params: query
  })
}

/**
 * 报告解析
 * @param file
 */
export function geneParsing(file) {
  return request({
    url: '/gene-face/gene/parsing', method: 'post', headers: {
      'Content-Type': 'multipart/form-data'
    }, data: file
  })
}

/**
 * 报告解析list
 * @param query
 */
export function geneParsingList(query) {
  return request({
    url: '/gene-face/gene/parsingList', method: 'get', params: query
  })
}

/**
 * 报告解析list
 * @param query
 */
export function deleteParsingById(id) {
  return request({
    url: '/gene-face/gene/parsingDelete/' + id, method: 'delete'
  })
}

/**
 * 用药建议获取
 * @param data
 */
export function getZskDrugSuggested(data) {
  return request({
    url: '/ruleConfig/getZskDrugSuggested', method: 'post', data: data
  })
}

/**
 * 获取用户所有药物用药建议获取
 * @param data
 */
export function getZskDrugSuggestedAll(data) {
  return request({
    url: '/ruleConfig/getZskDrugSuggestedAll', method: 'post', data: data
  })
}

